<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="app"></div>
</body>
<script>
    let demo = {
        props: ['count', 'count1'],
        emits: ['update:count', 'update:count1'],
        template: `<div>demo
                        {{count}}
                        {{count1}}
                        <button @click="handler">点击</button>
                        <button @click="handler1">点击</button>
                    </div>`,
        methods: {
            handler () {
                this.$emit('update:count', this.count + 1)
            },
            handler1 () {
                this.$emit('update:count1', this.count1 + 1)
            }
        }
    }
    let vm = {
        data () {
            return {
                count: 0,
                count1: 0
            }
        },
        components: { demo },
        template: `<demo v-model:count="count" v-model:count1="count1"/>`//单个可以直接写v-model="count"
        // @update:modelValue="count=$event.target.value"
        // :modelValue="count"
    }
    Vue.createApp(vm).mount('#app')
</script>

</html>